package com.hluobo.library.service.impl;

import java.util.List;

import org.springframework.stereotype.Component;

import com.hluobo.library.dao.impl.BasicDao;
import com.hluobo.library.model.Announcement;
import com.hluobo.library.service.AnnouncementService;

@Component("announcementService")
public class AnnouncementServiceImpl extends BasicDao implements AnnouncementService {

	@Override
	public Announcement queryById(int id) {
		return this.query(Announcement.class, id);
	}

	@Override
	public List<Announcement> queryAll() {
		String sql = "From Announcement a where a.visiable = true";
		
		return em.createQuery(sql).getResultList();
	}

	
	
}
